<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/commons/include/html_doctype.html" %>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<%@include file="/commons/page/codegen.jsp" %>
		<script type="text/javascript" src="${ctx}/js/gpoint/rdp/zoneCTL/doorController.js"></script>
		<style>
		    .doorinfo{
		        margin-top: 150px;
			    width: 95%;
			    text-align: left;
			    margin-left: 55px;		    
		    }
		    
		    
		    .dwh {
			    border: 1px solid #80808052;
			    text-align: center;
			    background-color: #80808024;
			}
			
			.ic {
			    display: inline-block;
			    width: 60px;
			    height: 25px;
			    vertical-align: middle;
			    margin-top: 5px;
			}
			.mycheckbox{
			    width: 25px;
			}
		</style>
	</head>
	<body>
		<div class="panel-toolbar ">
			<div class="buttons">
				<a href="javascript:void(0);" class="btn btn-primary fa fa-save" id="saveButtton"><span>保存</span></a>
				<a href="javascript:void(0);" class="btn btn-primary fa" id="checkParam"  onclick ="checkParam();" ><span>查看</span></a>
				<a href="javascript:void(0);" class="btn btn-primary fa" id="sendParam"  onclick ="saveNetAndLocal();" ><span>下发</span></a>
				
				<a href="javascript:void(0);" class="btn btn-primary fa" id="reset"  onclick ="reset();" ><span>恢复出厂设置</span></a>
				
				<a href="javascript:void(0);" class="btn btn-primary fa" id="reset"  onclick ="validatetime();" ><span>时间校准</span></a>
				
				<a href="javascript:void(0);" class="btn btn-primary fa" id="segmentAssign"  onclick ="segmentAssign();" ><span>时间段分配</span></a>
				
				<a href="list.htm" class="btn btn-primary fa fa-back" ><span>返回</span></a>
			</div>
		</div>
		<!-- 顶部按钮 -->
		
		<div class="wrapper wrapper-content  animated fadeInRight col-sm-12">
			<div class="">
				<form  class="fr-form" method="post" enctype='application/json' id="doorControllerForm" action="save.htm" >
					<input type="hidden" id="controllerid" name="m:doorController:controllerid"  value="${doorController.controllerid}"/>
					<input type="hidden" name="m:doorController:servicecode"  value="${doorController.servicecode}"/>
					<input type="hidden" name="m:doorController:editflag"  value="0"/>
							<div class="fr_response_field col-sm-4" >
							 	<div class="fr-form-group"> 
								 	<label class="fr-control-label">产品序列号</label>
								  	<div class="fr-form-block" data-type="fixed">
								         <input type="text" class="fr-form-control" id="ctlno"  readonly="readonly" name="m:doorController:controllersn" value="${doorController.controllersn}" validate="{required:true}"  onchange="upperCase(this.id)"/>				  					
								 	</div>
							  	</div>
							</div>
							
							<div class="fr_response_field col-sm-4" >
							 	<div class="fr-form-group"> 
								 	<label class="fr-control-label">控制器名称</label>
								  	<div class="fr-form-block" data-type="fixed">
								         <input type="text" id= "controllerName" class="fr-form-control"  name="m:doorController:controllerno" value="${doorController.controllerno}"  onchange="setDoorsName();" validate="{required:true}"/>				  					
								 	</div>
							  	</div>
							</div>

							<div class="fr_response_field col-sm-4" >
							 	<div class="fr-form-group"> 
								 	<label class="fr-control-label">IP地址</label>
								  	<div class="fr-form-block" data-type="fixed">
								          <input type="text" class="fr-form-control" name="m:doorController:ipa" value="${doorController.ipa}" validate="{required:true}"/>				  					
								 	</div>
							  	</div>
							</div>
							
							<div class="fr_response_field col-sm-4" >
							 	<div class="fr-form-group"> 
								 	<label class="fr-control-label">端口号</label>
								  	<div class="fr-form-block" data-type="fixed">
								        <input type="number" class="fr-form-control" name="m:doorController:port" value="${doorController.port}" validate="{required:true}"/> 					
								 	</div>
							  	</div>
							</div>
							
							<div class="fr_response_field col-sm-4" >
							 	<div class="fr-form-group"> 
								 	<label class="fr-control-label">子网掩码</label>
								  	<div class="fr-form-block" data-type="fixed">
								          <input type="text" class="fr-form-control" name="m:doorController:submask" value="${doorController.submask}" validate="{required:true}"/>				  					
								 	</div>
							  	</div>
							</div>
							<div class="fr_response_field col-sm-4" >
							 	<div class="fr-form-group"> 
								 	<label class="fr-control-label">网关</label>
								  	<div class="fr-form-block" data-type="fixed">
								          <input type="text" class="fr-form-control" name="m:doorController:gateway" value="${doorController.gateway}" validate="{required:true}"/>				  					
								 	</div>
							  	</div>
							</div>
							
						   <div class="fr_response_field col-sm-4">
								<div class="fr-form-group">
									<label class="fr-control-label">所在区域</label>
									<div class="fr-form-block" data-type="fixed">
									    <input name="m:doorController:zoneid" type="hidden"   id="hid_zoneid" value="${doorController.zoneid}"/>						    					
									    <input type="text" data-key="#hid_zoneid" readonly="readonly"  class="form-control comboTree" data-toggle="dictionary" data-url="${ctx}/rdp/area/zone/list_json_tree.htm?" value="${doorController.zonename}"  validate="{required:true}"/>
									</div>
								</div>
							</div>
							 	
							 	
							<div class="fr_response_field col-sm-4" >
							 	<div class="fr-form-group"> 
								 	<label class="fr-control-label">备注</label>
								  	<div class="fr-form-block" data-type="fixed">
								<input type="text" class="fr-form-control" name="m:doorController:note" value="${doorController.note}" validate="{required:false}"/>
								  					
								 	</div>
							  	</div>
							</div>
							 	 
		
						    <input  type="hidden"  id="doorsnamesx" name="m:doorController:doorsnames" value="${doorController.doorsnames}" validate="{required:true}"/>				  					

							
							<div class="fr_response_field col-sm-2" >
							 	<div class="fr-form-group"> 
								 	<label class="fr-control-label">启用</label>
								  	<div class="fr-form-block" data-type="fixed">
								         
								         <c:if test="${doorController.enabled == '1'}">  
								     			<input  type="checkbox" id="cbCheckbox1"  class="fr-form-control" name="m:doorController:enabled" value="1" checked="checked" style = "width:20px;" validate="{required:false}"/>					  										 	
								         </c:if>
								         <c:if test="${doorController.enabled != '1'}">  
								     			<input  type="checkbox" id="cbCheckbox1"  class="fr-form-control" name="m:doorController:enabled" value="1" style = "width:20px;" validate="{required:false}"/>		
								         </c:if>		  					
								 	</div>
							  	</div>
							</div>						                        
				</form>

			</div>
		</div>
			  	
	<script type="text/javascript" >
			$(function(){
				var num = '${doorController.controllersn}';
				upperCase(num);
			});
			
			function openDialog(){
			    	
				  var iwidth = 1000;
				  var iheight = 500;
				  var itop = (window.screen.availHeight-iheight)/2;       //获得窗口的垂直位置;
				  var ileft = (window.screen.availWidth-iwidth)/2;      //获得窗口的水平位置; 		   		   
				  win = window.open(
						"http://127.0.0.1:8083/rdp/zoneCTL/doorZone/list2.htm", 
						"区域管理", 
						"status=no,location=no,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,top="+itop+",left="+ileft+",width="+iwidth+",height="+iheight
				   );   
			 }
		 
			 function upperCase(x)
			 {
				 
				 var sn = $("#ctlno").val();
				 if (sn.startsWith("1")) {					 
					$("#doorInfo").show();
					$("#menu_item1").show();
					$("#menu_item2").hide();
					$("#menu_item3").hide();					
				 }
				 else if (sn.startsWith("2")) {
					 $("#doorInfo").show();
					 $("#menu_item1").hide();
					 $("#menu_item2").show();
					 $("#menu_item3").hide();										 
				 }
				 else if (sn.startsWith("4")) {
					 $("#doorInfo").show();
					 $("#menu_item1").hide();
					 $("#menu_item2").hide();
					 $("#menu_item3").show(); 
				 }	
				 else{
					 $("#doorInfo").hide();
				 }			 
			 }
			 
			 function setDoorsName()
			 {
				 var sn = $("#ctlno").val();
				 var controllerName = $("#controllerName").val();
				 if (sn.startsWith("1")) {	
					var title = $("#doorsnames11").attr("title");
					$("#doorsnames11").val(controllerName+"_"+title);
				
				 }
				 else if (sn.startsWith("2")) {
						var title = $("#doorsnames21").attr("title");
						$("#doorsnames21").val(controllerName+"_"+title);
						var title = $("#doorsnames22").attr("title");
						$("#doorsnames22").val(controllerName+"_"+title);	
				 }
				 else if (sn.startsWith("4")) {
						var title = $("#doorsnames41").attr("title");
						$("#doorsnames41").val(controllerName+"_"+title);
						var title = $("#doorsnames42").attr("title");
						$("#doorsnames42").val(controllerName+"_"+title);	
						var title = $("#doorsnames43").attr("title");
						$("#doorsnames43").val(controllerName+"_"+title);
						var title = $("#doorsnames44").attr("title");
						$("#doorsnames44").val(controllerName+"_"+title);	
				 }	
			 
			 }
			 			 
			 //查看控制器门控制方式
			 var contactChar="&";
			 var sn = '${doorController.controllersn}';
			 
			 //现在需要做的是根据SN获取网络中的控制器和门信息
			 function checkParam(){				 
					 DialogUtil.dialog(
							 {
					 				title : "网络门信息",
					 				content : '${ctx}/rdp/zoneCTL/doorController/netDetail.htm?controllerid=${doorController.controllerid}',
					 				area : [ '1500px', '650px' ],
					 				maxmin : false
					 				//end : function() {
									//	$("#doorControllerGrid").trigger("reloadGrid");
									//}
					 			
					 			
					 		}
					 );				 
			 }
			 
			 function saveNetAndLocal(){
				 //调用保存接口
				 //alert("执行下发");
				 $("#saveButtton").click();	
			 }
			 
			 //立即下发
			 function sendParam(){
				// alert("下发参数");
				 var result = false;
				 var address='${address}';
				// var url="http://192.168.0.186:8025/setDoorMessage?";
				var url=address+"/setDoorMessage?"; 
				var paramSn = "sn="+sn;
				 
				 if(sn.startsWith("1")){
                      var doorParam1 = "door="+1;
					  var pc1 = $("input[name='ctrl11']:checked").val();//控制方式
					  var pd1 = $("#delay11").val();//延时	
                      var r = setSingleDoor(url,paramSn,doorParam1,pc1,pd1)
                      result = r;
					 
				 }else if(sn.startsWith("2") ){
					 var doorParam1 = "door="+1;
					 var pc1 = $("input[name='ctrl21']:checked").val();
					 var pd1 = $("#delay21").val();	
					 var r1 = setSingleDoor(url,paramSn,doorParam1,pc1,pd1)
					 
					 var doorParam2 = "door="+2;
					 var pc2 = $("input[name='ctrl22']:checked").val();
					 var pd2 = $("#delay22").val();	
					 var r2 = setSingleDoor(url,paramSn,doorParam2,pc2,pd2)

					 result = r1&&r2;
					 
				 }else if(sn.startsWith("4") ){
					  var doorParam1 = "door="+1;
					  var pc1 = $("input[name='ctrl41']:checked").val();
					  var pd1 = $("#delay41").val();
					  var r1 = setSingleDoor(url,paramSn,doorParam1,pc1,pd1)

					  var doorParam2 = "door="+2;
					  var pc2 = $("input[name='ctrl42']:checked").val();
					  var pd2 = $("#delay42").val();
					  var r2 = setSingleDoor(url,paramSn,doorParam2,pc2,pd2)
					  
					  var doorParam3 = "door="+3;
					  var pc3 = $("input[name='ctrl43']:checked").val();
					  var pd3 = $("#delay43").val();
					  var r3 = setSingleDoor(url,paramSn,doorParam3,pc3,pd3)
					  
					  var doorParam4 = "door="+4;
					  var pc4 = $("input[name='ctrl44']:checked").val();
					  var pd4 = $("#delay44").val();
					  var r4 = setSingleDoor(url,paramSn,doorParam4,pc4,pd4)
					  result=r1&&r2&&r3&&r4;
					  
				 }
				 return result; 
			 }
			 
			 
			 function setSingleDoor(url,snParam,doorParam,pcn,pdn){
				 var result = false;
				 var controllerParam = "controller="+pcn;
				 var opendelayParam = "opendelay="+ pdn;
				 var seetingUrl =url+snParam+contactChar+doorParam+contactChar+controllerParam+contactChar+opendelayParam;
				 
				 $.ajax({
  					url : seetingUrl,
  					type : "GET",
  					contentType : "application/json",
  					//data:JSON.stringify(map),
  					dataType : "json",
  					async : false,
  					success : function(data) {
  						console.log(data);
  						if(data.code!=200){
  							result=false;
  							//alert("下发异常");
  							DialogUtil.confirm(data.mess + ',是否继续操作',
									function(rtn) {
									if(rtn){
										window.location.reload(true);
												   
									}   
									else{
										
									}
								    	
									});
  						}else{
  							result=true;
  							//alert("下发成功");
  							DialogUtil.confirm(data.mess + ',是否继续操作',
									function(rtn) {
									if(rtn){
										window.location.reload(true);
												   
									}   
									else{
										
									}
								    	
									});
  						}  
  						
  						
  					},
  					error:function(xhr,textStatus){
  						alert("下发错误");
  					}
  			   
  				});					 
				 return result;				 
			 }
			 
		
			
			 
			 
			function reset(){
				 // var  context="http://192.168.0.190:8025";
				   var context='${address}';
				 //alert("执行恢复出厂设置");
				//获取sn 
				sn=${doorController.controllersn};
				//alert("sn="+sn);
				//发送请求
				 	 //调用接口获取时间参数
         $.ajax({
		    	         	type: "GET",
		    	         	   url: context+"/resetSn?sn="+sn,
		    	         	    async: false,//使用同步操作，否则init方法执行时setting可能还未被赋值
		    	         	   success: function(data) {
		    	         		  console.log(data);
		    	         		    if(data.code==200){
		    	         		    
		    	         		    	//弹框，显示retcode 和msg
		    	         		    	 //alert("执行恢复出厂成功！");
		    	         		    	 DialogUtil.confirm(data.mess + ',是否继续操作',
													function(rtn) {
													if(rtn){
														window.location.reload(true);
																   
													}   
													else{
														
													}
												    	
													});
		    	         		    	
		    	         		    }else{
		    	         		    	//alert("执行恢复出厂异常！");
		    	         		    	 DialogUtil.confirm(data.mess + ',是否继续操作',
													function(rtn) {
													if(rtn){
														window.location.reload(true);
																   
													}   
													else{
														
													}
												    	
													});
		    	         		    	 
		    	         		    }
		    	         	         
		    	         	  },
		    	         	 error: function(){
		    	         		//  alert("执行恢复出厂失败！");
		    	         		 DialogUtil.confirm(data.mess + ',是否继续操作',
											function(rtn) {
											if(rtn){
												window.location.reload(true);
														   
											}   
											else{
												
											}
										    	
											});
		    	              }
		    	         	 
		    	         	 });  
		    	         	 //end
				
			}
			
			
			//时间校准
		   function	validatetime(){
			 //  alert("时间校准执行");
				
				//获取数值beign
				
				//获取的应该是门编号：传递参数应该是设备_门编号例如 ：
		//133118548_1
		    sn=${doorController.controllersn};
		    
		     //doorno= getdoorno(); 为了拼凑SN_Door 的形式，加一个固定的参数
		        doorno=sn+"_1";  //后面的固定数值仅仅是为了数据格式传递
		     
		         var address='${address}';
		         context=address;
		       // var context="http://127.0.0.1:8083";
				//校验
				 var map ={};
			     map.doorArr = doorno;
				
				//调用接口
				  $.ajax({
				    	         	type: "post",
				    	         	 url: context+"/calibrationTime",
				    	         	    contentType: "application/json;charset=utf-8;",
				    	         	   data:JSON.stringify(map),
				    	         	  dataType:"json",//注意不是datatype哦
				    	         	    async: false,//使用同步操作，否则init方法执行时setting可能还未被赋值
				    	         	   success: function(data) {
				    	         	          
				    	         	 
						    	         	console.log(data);
					    	         		
				    	         		    if(data.code==200){
				    	         		    	//alert("时间校准成功！");
				    	         		    	 DialogUtil.confirm('校准时间为：'+data.dateTime + ',是否继续操作',
															function(rtn) {
															if(rtn){
																window.location.reload(true);
																		   
															}   
															else{
																
															}
														    	
															});
				    	         		    	 
				    	         		    	 
				    	         		    }else{
				    	         		    	alert("时间校准异常！");
				    	         		    }
				    	         	  },
				    	         	 error: function(){
				    	         		  alert("时间校准失败！");
				    	              }
				    	         	 });
				    	         	 //end
			   
		   }
			
			
			
			
	//时间段分配函数
	function segmentAssign(){
		
		//alert("时间段函数执行");
		
	 
		//获取SN并传参
			sn=${doorController.controllersn};
		
		
		//弹出框供选择，这里单独跳装好像不行
		 DialogUtil.dialog(
				 {
		 				title : "时间段明细",
		 				//content : '${ctx}/rdp/zone/doorZone/timeSegListDetail.htm',
		 			 //   content : '${ctx}/rdp/TimeSegment/timeSeg/list.htm?sn='+sn,
		 					  content : '${ctx}/rdp/TimeSegment/timeSeg/list2.htm?sn='+sn,
		 				area : [ '1500px', '650px' ],
		 				maxmin : false
		 				//end : function() {
						//	$("#doorControllerGrid").trigger("reloadGrid");
						//}
		 			
		 			
		 		}
		 );				
		
		
	}
		</script>
		
		
		<div id = "doorInfo" class="panel panel-default doorinfo" style="display:none">
			  <div class="panel-heading">门信息</div>
			  <div class="panel-body">
			            
					      <div style="display:none" id="menu_item1">
                               <c:if test="${doorController.controllersn.substring(0,1)=='1' }"> 
							        <div class="fr_response_field col-sm-2"  >
									 	<div class="fr-form-group"> 
										 	<label class="fr-control-label">1号门</label>
										  	<div class="fr-form-block" data-type="fixed">
										  	    <input id ="doorsid11"  type="hidden" value="${doorController.doors.size()==1?doorController.doors.get(0).doorid:''}"/>
										        <input type="text"  title="1号门" class="fr-form-control door" id="doorsnames11" name="m:doorController:doorsnames" value="${doorController.doors.size()==1? doorController.doors.get(0).doorname:''}" validate="{required:false}"/>				
										 	</div>
									  	</div>
									</div>	
									<div class="fr_response_field col-sm-2"  >
									 	<div class="fr-form-group"> 
										 	<label class="fr-control-label">控制方式</label>
										  	<div class="fr-form-block dwh" data-type="fixed" >			
										        <div class="ic"><input type="radio"  name="ctrl11" value="3" ${doorController.doors.size()==1 and doorController.doors.get(0).doorcontrol eq '3' or doorController.doors.size()==0? 'checked=true':''}>在线</div> 
												<div class="ic"><input type="radio"  name="ctrl11" value="1" ${doorController.doors.size()==1 and doorController.doors.get(0).doorcontrol eq '1'? 'checked=true':''}>常开</div> 
												<div class="ic"><input type="radio"  name="ctrl11" value="2" ${doorController.doors.size()==1 and doorController.doors.get(0).doorcontrol eq '2'? 'checked=true':''}>常闭</div>								        			  					
										 	</div>
									  	</div>
									</div>
									
									<div class="fr_response_field col-sm-2"  >
									 	<div class="fr-form-group"> 
										 	<label class="fr-control-label">开门延时(s)</label>
										  	<div class="fr-form-block" data-type="fixed">
										        <input type="number"  class="fr-form-control" id="delay11" value="${doorController.doors.size()==1 ? doorController.doors.get(0).doordelay:3}"/>				  					
										 	</div>
									  	</div>
									</div>
																		
								   <%--  <div class="fr_response_field col-sm-2"  >
									 	<div class="fr-form-group"> 
										 	<label class="fr-control-label">进门</label>
										  	<div class="fr-form-block" data-type="fixed">
										       <input type="checkbox" class="fr-form-control mycheckbox" id="doors111" name="m:doorController:doorsnames" value="1"  ${doorController.doors.size()==1 and doorController.doors.get(0).doorenabled.substring(0,1) eq '1'? 'checked=true':''} validate="{required:false}"/>					  					
										 	</div>
									  	</div>
									</div>	 
									
									<div class="fr_response_field col-sm-2"  >
									 	<div class="fr-form-group"> 
										 	<label class="fr-control-label">出门</label>
										  	<div class="fr-form-block" data-type="fixed">
										        <input type="checkbox" class="fr-form-control mycheckbox" id="doors112" name="m:doorController:doorsnames" value="1" ${doorController.doors.size()==1 and doorController.doors.get(0).doorenabled.substring(1,2) eq '1'? 'checked=true':''} validate="{required:false}"/>				  					
										 	</div>
									  	</div>
									</div>	  --%>
									
									
									
							<div class="fr_response_field col-sm-2">
								<div class="fr-form-group">
									<label class="fr-control-label">所在区域</label>
									<div class="fr-form-block" data-type="fixed">
									    <input name="m:doorController:zoneid11" type="hidden"   id="zoneid11" value="${doorController.doors.get(0).zoneid}"/>						    					
									    <input type="text" data-key="#zoneid11" readonly="readonly"  class="form-control comboTree" data-toggle="dictionary" data-url="${ctx}/rdp/area/zone/list_json_tree.htm?" value="${doorController.doors.get(0).zonename}"  validate="{required:true}"/>
									</div>
								</div>
							</div>	
							
									   
							 	</c:if>
						 </div>
							
							
						<div style="display:none" id="menu_item2" name="form" method="post" action=""> 
						    <c:if test="${doorController.controllersn.substring(0,1)=='2' }"> 
								<div class="fr_response_field col-sm-2"  >
								 	<div class="fr-form-group"> 
									 	<label class="fr-control-label">1号门</label>
									  	<div class="fr-form-block" data-type="fixed">
									  	    <input id ="doorsid21"  type="hidden" value="${doorController.doors.size()==2?doorController.doors.get(0).doorid:''}"/>
									        <input type="text" title="1号门" class="fr-form-control door" id="doorsnames21" name="m:doorController:doorsnames" value="${doorController.doors.size()==2?doorController.doors.get(0).doorname:''}" validate="{required:false}"/>				  					
									 	</div>
								  	</div>
								</div>	
								<div class="fr_response_field col-sm-2"  >
								 	<div class="fr-form-group"> 
									 	<label class="fr-control-label">控制方式</label>
									  	<div class="fr-form-block dwh" data-type="fixed" >			
									        <div class="ic"><input type="radio"  name="ctrl21" value="3" ${doorController.doors.size()==2 and doorController.doors.get(0).doorcontrol eq '3' or  doorController.doors.size()==0? 'checked=true':''}>在线</div> 
											<div class="ic"><input type="radio"  name="ctrl21" value="1" ${doorController.doors.size()==2 and doorController.doors.get(0).doorcontrol eq '1'? 'checked=true':''}>常开</div> 
											<div class="ic"><input type="radio"  name="ctrl21" value="2" ${doorController.doors.size()==2 and doorController.doors.get(0).doorcontrol eq '2'? 'checked=true':''}>常闭</div>								        			  					
									 	</div>
								  	</div>
								</div>
								
								<div class="fr_response_field col-sm-2"  >
								 	<div class="fr-form-group"> 
									 	<label class="fr-control-label">开门延时(s)</label>
									  	<div class="fr-form-block" data-type="fixed">
									        <input type="number"  class="fr-form-control" id="delay21" value="${doorController.doors.size()==2?doorController.doors.get(0).doordelay:3}"/>				  					
									 	</div>
								  	</div>
								</div>
																 
							<%-- 	<div class="fr_response_field col-sm-2"  >
									 	<div class="fr-form-group"> 
										 	<label class="fr-control-label">进门</label>
										  	<div class="fr-form-block" data-type="fixed">
										        <input type="checkbox" class="fr-form-control mycheckbox" id="doors211" name="m:doorController:doorsnames" value="1" ${doorController.doors.size()==2 and doorController.doors.get(0).doorenabled.substring(0,1) eq '1'? 'checked=true':''} validate="{required:false}"/>				  					
										 	</div>
									  	</div>
								</div>	 
								<div class="fr_response_field col-sm-2"  >
								 	<div class="fr-form-group"> 
									 	<label class="fr-control-label">出门</label>
									  	<div class="fr-form-block" data-type="fixed">
									        <input type="checkbox" class="fr-form-control mycheckbox" id="doors212" name="m:doorController:doorsnames" value="1" ${doorController.doors.size()==2 and doorController.doors.get(0).doorenabled.substring(1,2) eq '1'? 'checked=true':''} validate="{required:false}"/>				
									 	</div>
								  	</div>
								</div>	 
								 --%>
								
								<div class="fr_response_field col-sm-2">
								<div class="fr-form-group">
									<label class="fr-control-label">所在区域</label>
									<div class="fr-form-block" data-type="fixed">
									    <input name="m:doorController:zoneid21" type="hidden"   id="zoneid21" value="${doorController.doors.get(0).zoneid}"/>						    					
									    <input type="text" data-key="#zoneid21" readonly="readonly"  class="form-control comboTree" data-toggle="dictionary" data-url="${ctx}/rdp/area/zone/list_json_tree.htm?" value="${doorController.doors.get(0).zonename}"  validate="{required:true}"/>
									</div>
								</div>
							</div>	
							
							   <br></br>
							
							
								
								 	<div class="fr-form-group col-sm-2"> 
									 	<label class="fr-control-label">2号门</label>
									  	<div class="fr-form-block" data-type="fixed">
									  	   <input id ="doorsid22"  type="hidden" value="${doorController.doors.size()==2?doorController.doors.get(1).doorid:''}"/>
									        <input type="text" title="2号门" class="fr-form-control door" id="doorsnames22" name="m:doorController:doorsnames" value="${doorController.doors.size()==2 ? doorController.doors.get(1).doorname:''}" validate="{required:false}"/>				  					
									 	</div>
								  	</div>
									
								
												
							
							
							
								<div class="fr_response_field col-sm-2"  >
								 	<div class="fr-form-group"> 
									 	<label class="fr-control-label">控制方式</label>
									  	<div class="fr-form-block dwh" data-type="fixed" >			
									        <div class="ic"><input type="radio"  name="ctrl22" value="3" ${doorController.doors.size()==2 and doorController.doors.get(1).doorcontrol eq '3' or doorController.doors.size()==0? 'checked=true':''}>在线</div> 
											<div class="ic"><input type="radio"  name="ctrl22" value="1" ${doorController.doors.size()==2 and doorController.doors.get(1).doorcontrol eq '1'? 'checked=true':''}>常开</div> 
											<div class="ic"><input type="radio"  name="ctrl22" value="2" ${doorController.doors.size()==2 and doorController.doors.get(1).doorcontrol eq '2'? 'checked=true':''}>常闭</div>								        			  					
									 	</div>
								  	</div>
								</div>
								
								<div class="fr_response_field col-sm-2"  >
								 	<div class="fr-form-group"> 
									 	<label class="fr-control-label">开门延时(s)</label>
									  	<div class="fr-form-block" data-type="fixed">
									        <input type="number"  class="fr-form-control" id="delay22" value="${doorController.doors.size()==2?doorController.doors.get(1).doordelay:3}"/>				  					
									 	</div>
								  	</div>
								</div> 
								<%-- <div class="fr_response_field col-sm-2"  >
									 	<div class="fr-form-group"> 
										 	<label class="fr-control-label">进门</label>
										  	<div class="fr-form-block" data-type="fixed">
										        <input type="checkbox" class="fr-form-control mycheckbox" id="doors221" name="m:doorController:doorsnames" value="1" ${doorController.doors.size()==2 and doorController.doors.get(1).doorenabled.substring(0,1) eq '1'? 'checked=true':''} />				  					
										 	</div>
									  	</div>
								</div>	 
								<div class="fr_response_field col-sm-2"  >
								 	<div class="fr-form-group"> 
									 	<label class="fr-control-label">出门</label>
									  	<div class="fr-form-block" data-type="fixed">
									        <input type="checkbox" class="fr-form-control mycheckbox" id="doors222" name="m:doorController:doorsnames" value="1" ${doorController.doors.size()==2 and doorController.doors.get(1).doorenabled.substring(1,2) eq '1'? 'checked=true':''}"/>				
									 	</div>
								  	</div>
								</div>	  --%>
								
											
							<div class="fr_response_field col-sm-2">
								<div class="fr-form-group">
									<label class="fr-control-label">所在区域</label>
									<div class="fr-form-block" data-type="fixed">
									    <input name="m:doorController:zoneid22" type="hidden"   id="zoneid22" value="${doorController.doors.get(0).zoneid}"/>						    					
									    <input type="text" data-key="#zoneid22" readonly="readonly"  class="form-control comboTree" data-toggle="dictionary" data-url="${ctx}/rdp/area/zone/list_json_tree.htm?" value="${doorController.doors.get(1).zonename}"  validate="{required:true}"/>
									</div>
								</div>
							</div>	
							
																					
							</c:if>																									
						</div>
						
						 <div style="display:none" id="menu_item3" name="form" method="post" action="">
							 <c:if test="${doorController.controllersn.substring(0,1)=='4'}"> 
								 <div class="fr_response_field col-sm-3"  >
									 	<div class="fr-form-group"> 
										 	<label class="fr-control-label">1号门</label>
										  	<div class="fr-form-block" data-type="fixed">
										  	   <input id ="doorsid41"  type="hidden" value="${doorController.doors.size()==4?doorController.doors.get(0).doorid:''}"/>
										        <input type="text" title="1号门" class="fr-form-control door" id="doorsnames41" name="m:doorController:doorsnames" value="${doorController.doors.size()==4? doorController.doors.get(0).doorname:''}" validate="{required:false}"/>				  					
										 	</div>
									  	</div>
									</div>
									<div class="fr_response_field col-sm-3"  >
									 	<div class="fr-form-group"> 
										 	<label class="fr-control-label">控制方式</label>
										  	<div class="fr-form-block dwh" data-type="fixed" >			
										        <div class="ic"><input type="radio"  name="ctrl41" value="3" ${doorController.doors.size()==4 and doorController.doors.get(0).doorcontrol eq '3' or doorController.doors.size()==0? 'checked=true':''}>在线</div> 
												<div class="ic"><input type="radio"  name="ctrl41" value="1" ${doorController.doors.size()==4 and doorController.doors.get(0).doorcontrol eq '1'? 'checked=true':''}>常开</div> 
												<div class="ic"><input type="radio"  name="ctrl41" value="2" ${doorController.doors.size()==4 and doorController.doors.get(0).doorcontrol eq '2'? 'checked=true':''}>常闭</div>								        			  					
										 	</div>
									  	</div>
									</div>
									
									<div class="fr_response_field col-sm-2"  >
									 	<div class="fr-form-group"> 
										 	<label class="fr-control-label">开门延时(s)</label>
										  	<div class="fr-form-block" data-type="fixed">
										        <input type="number"  class="fr-form-control" id="delay41" value="${doorController.doors.size()==4?doorController.doors.get(0).doordelay:3}"/>				  					
										 	</div>
									  	</div>
									</div> 	 
									<%-- <div class="fr_response_field col-sm-2"  >
										 	<div class="fr-form-group"> 
											 	<label class="fr-control-label">进门</label>
											  	<div class="fr-form-block" data-type="fixed">
											        <input type="checkbox" class="fr-form-control mycheckbox" id="doors411" name="m:doorController:doorsnames" value="1" ${doorController.doors.size()==4 and doorController.doors.get(0).doorenabled.substring(0,1) eq '1'? 'checked=true':''}/>				  					
											 	</div>
										  	</div>
									</div> --%>
									
											
							<div class="fr_response_field col-sm-2">
								<div class="fr-form-group">
									<label class="fr-control-label">所在区域</label>
									<div class="fr-form-block" data-type="fixed">
									    <input name="m:doorController:zoneid41" type="hidden"   id="zoneid41" value="${doorController.doors.get(0).zoneid}"/>						    					
									    <input type="text" data-key="#zoneid41" readonly="readonly"  class="form-control comboTree" data-toggle="dictionary" data-url="${ctx}/rdp/area/zone/list_json_tree.htm?" value="${doorController.doors.get(0).zonename}"  validate="{required:true}"/>
									</div>
								</div>
							</div>	
							
							
									<div class="fr_response_field col-sm-3"  >
									 	<div class="fr-form-group"> 
										 	<label class="fr-control-label">2号门</label>
										  	<div class="fr-form-block" data-type="fixed">
										  	    <input id ="doorsid42"  type="hidden" value="${doorController.doors.size()==4?doorController.doors.get(1).doorid:''}"/>
										        <input type="text" title="2号门" class="fr-form-control door" id="doorsnames42" name="m:doorController:doorsnames" value="${doorController.doors.size()==4? doorController.doors.get(1).doorname:''}" validate="{required:false}"/>				  					
										 	</div>
									  	</div>
									</div>
									<div class="fr_response_field col-sm-3"  >
									 	<div class="fr-form-group"> 
										 	<label class="fr-control-label">控制方式</label>
										  	<div class="fr-form-block dwh" data-type="fixed" >			
										        <div class="ic"><input type="radio"  name="ctrl42" value="3" ${doorController.doors.size()==4 and doorController.doors.get(1).doorcontrol eq '3' or doorController.doors.size()==0? 'checked=true':''} >在线</div> 
												<div class="ic"><input type="radio"  name="ctrl42" value="1" ${doorController.doors.size()==4 and doorController.doors.get(1).doorcontrol eq '1'? 'checked=true':''}>常开</div> 
												<div class="ic"><input type="radio"  name="ctrl42" value="2" ${doorController.doors.size()==4 and doorController.doors.get(1).doorcontrol eq '2'? 'checked=true':''}>常闭</div>								        			  					
										 	</div>
									  	</div>
									</div>
									
									<div class="fr_response_field col-sm-2"  >
									 	<div class="fr-form-group"> 
										 	<label class="fr-control-label">开门延时(s)</label>
										  	<div class="fr-form-block" data-type="fixed">
										        <input type="number"  class="fr-form-control" id="delay42" value="${doorController.doors.size()==4?doorController.doors.get(1).doordelay:3}"/>				  					
										 	</div>
									  	</div>
									</div> 	 
									<%-- <div class="fr_response_field col-sm-2"  >
										 	<div class="fr-form-group"> 
											 	<label class="fr-control-label">进门</label>
											  	<div class="fr-form-block" data-type="fixed">
											        <input type="checkbox" class="fr-form-control mycheckbox" id="doors421" name="m:doorController:doorsnames" value="1" ${doorController.doors.size()==4 and doorController.doors.get(1).doorenabled.substring(0,1) eq '1'? 'checked=true':''} />				  					
											 	</div>
										  	</div>
									</div>	 --%>
									
									
											
							<div class="fr_response_field col-sm-2">
								<div class="fr-form-group">
									<label class="fr-control-label">所在区域</label>
									<div class="fr-form-block" data-type="fixed">
									    <input name="m:doorController:zoneid42" type="hidden"   id="zoneid42" value="${doorController.doors.get(0).zoneid}"/>						    					
									    <input type="text" data-key="#zoneid42" readonly="readonly"  class="form-control comboTree" data-toggle="dictionary" data-url="${ctx}/rdp/area/zone/list_json_tree.htm?" value="${doorController.doors.get(1).zonename}"  validate="{required:true}"/>
									</div>
								</div>
							</div>	
							
							
									<div class="fr_response_field col-sm-3"  >
									 	<div class="fr-form-group"> 
										 	<label class="fr-control-label">3号门</label>
										  	<div class="fr-form-block" data-type="fixed">
										  	    <input id ="doorsid43"  type="hidden" value="${doorController.doors.size()==4?doorController.doors.get(2).doorid:''}"/>
										        <input type="text" title="3号门" class="fr-form-control door" id="doorsnames43" name="m:doorController:doorsnames" value="${doorController.doors.size()==4 ?doorController.doors.get(2).doorname:''}" validate="{required:false}"/>				  					
										 	</div>
									  	</div>
									</div>	
									<div class="fr_response_field col-sm-3"  >
									 	<div class="fr-form-group"> 
										 	<label class="fr-control-label">控制方式</label>
										  	<div class="fr-form-block dwh" data-type="fixed" >			
										        <div class="ic"><input type="radio"  name="ctrl43" value="3" ${doorController.doors.size()==4 and doorController.doors.get(2).doorcontrol eq '3' or doorController.doors.size()==0? 'checked=true':''}>在线</div> 
												<div class="ic"><input type="radio"  name="ctrl43" value="1" ${doorController.doors.size()==4 and doorController.doors.get(2).doorcontrol eq '1'? 'checked=true':''}>常开</div> 
												<div class="ic"><input type="radio"  name="ctrl43" value="2" ${doorController.doors.size()==4 and doorController.doors.get(2).doorcontrol eq '2'? 'checked=true':''}>常闭</div>								        			  					
										 	</div>
									  	</div>
									</div>
									
									<div class="fr_response_field col-sm-2"  >
									 	<div class="fr-form-group"> 
										 	<label class="fr-control-label">开门延时(s)</label>
										  	<div class="fr-form-block" data-type="fixed">
										        <input type="number"  class="fr-form-control" id="delay43" value="${doorController.doors.size()==4?doorController.doors.get(2).doordelay:3}"/>				  					
										 	</div>
									  	</div>
									</div>  
								<%-- 	<div class="fr_response_field col-sm-2"  >
										 	<div class="fr-form-group"> 
											 	<label class="fr-control-label">进门</label>
											  	<div class="fr-form-block" data-type="fixed">
											        <input type="checkbox" class="fr-form-control mycheckbox" id="doors431" name="m:doorController:doorsnames" value="1" ${doorController.doors.size()==4 and doorController.doors.get(2).doorenabled.substring(0,1) eq '1'? 'checked=true':''} />				  					
											 	</div>
										  	</div>
									</div>	 --%>
									
											
							<div class="fr_response_field col-sm-2">
								<div class="fr-form-group">
									<label class="fr-control-label">所在区域</label>
									<div class="fr-form-block" data-type="fixed">
									    <input name="m:doorController:zoneid43" type="hidden"   id="zoneid43" value="${doorController.doors.get(0).zoneid}"/>						    					
									    <input type="text" data-key="#zoneid43" readonly="readonly"  class="form-control comboTree" data-toggle="dictionary" data-url="${ctx}/rdp/area/zone/list_json_tree.htm?" value="${doorController.doors.get(2).zonename}"  validate="{required:true}"/>
									</div>
								</div>
							</div>	
							
									<div class="fr_response_field col-sm-3"  >
									 	<div class="fr-form-group"> 
										 	<label class="fr-control-label">4号门</label>
										  	<div class="fr-form-block" data-type="fixed">
										  	    <input id ="doorsid44"  type="hidden" value="${doorController.doors.size()==4?doorController.doors.get(3).doorid:''}"/>
										        <input type="text" title="4号门" class="fr-form-control door" id="doorsnames44" name="m:doorController:doorsnames" value="${doorController.doors.size()==4?doorController.doors.get(3).doorname:''}" validate="{required:false}"/>				  					
										 	</div>
									  	</div>
									</div>	
									<div class="fr_response_field col-sm-3"  >
									 	<div class="fr-form-group"> 
										 	<label class="fr-control-label">控制方式</label>
										  	<div class="fr-form-block dwh" data-type="fixed" >			
										        <div class="ic"><input type="radio"  name="ctrl44" value="3" ${doorController.doors.size()==4 and doorController.doors.get(3).doorcontrol eq '3' or doorController.doors.size()==0? 'checked=true':''}>在线</div> 
												<div class="ic"><input type="radio"  name="ctrl44" value="1" ${doorController.doors.size()==4 and doorController.doors.get(3).doorcontrol eq '1'? 'checked=true':''}>常开</div> 
												<div class="ic"><input type="radio"  name="ctrl44" value="2" ${doorController.doors.size()==4 and doorController.doors.get(3).doorcontrol eq '2'? 'checked=true':''}>常闭</div>								        			  					
										 	</div>
									  	</div>
									</div>
									
									<div class="fr_response_field col-sm-2"  >
									 	<div class="fr-form-group"> 
										 	<label class="fr-control-label">开门延时(s)</label>
										  	<div class="fr-form-block" data-type="fixed">
										        <input type="number"  class="fr-form-control" id="delay44" value="${doorController.doors.size()==4?doorController.doors.get(3).doordelay:3}"/>				  					
										 	</div>
									  	</div>
									</div>  
								<%-- 	<div class="fr_response_field col-sm-2"  >
										 	<div class="fr-form-group"> 
											 	<label class="fr-control-label">进门</label>
											  	<div class="fr-form-block" data-type="fixed">
											        <input type="checkbox" class="fr-form-control mycheckbox" id="doors441" name="m:doorController:doorsnames" value="1" ${doorController.doors.size()==4 and doorController.doors.get(3).doorenabled.substring(0,1) eq '1'? 'checked=true':''}/>				  					
											 	</div>
										  	</div>
									</div> --%>	   
							 
							 			
							<div class="fr_response_field col-sm-2">
								<div class="fr-form-group">
									<label class="fr-control-label">所在区域</label>
									<div class="fr-form-block" data-type="fixed">
									    <input name="m:doorController:zoneid44" type="hidden"   id="zoneid44" value="${doorController.doors.get(0).zoneid}"/>						    					
									    <input type="text" data-key="#zoneid44" readonly="readonly"  class="form-control comboTree" data-toggle="dictionary" data-url="${ctx}/rdp/area/zone/list_json_tree.htm?" value="${doorController.doors.get(3).zonename}"  validate="{required:true}"/>
									</div>
								</div>
							</div>	
							
							 </c:if>
				
						</div>

			  </div>
		</div>				
	</body>
</html>